package com.cirkana.viewer.share;

import java.io.DataInputStream;
import java.io.DataOutputStream;

import com.cirkana.serial.SerializablePassData;
import com.cirkana.serial.SerializationException;

public class SharePassData extends SerializablePassData {

	private Integer shareType = ShareActivity.SHARE_CHANNEL_NOTSET;

	public Integer getShareType() {
		return shareType;
	}

	public void setShareType(Integer shareType) {
		this.shareType = shareType;
	}

	public SharePassData() {
	}

	public SharePassData(Integer shareType) {
		this.shareType = shareType;
	}

	@Override
	public void serialize(DataOutputStream out) throws SerializationException {
		serializeInteger(this.shareType, out);
	}

	@Override
	public void deserialize(DataInputStream in) throws SerializationException {
		this.shareType = deserializeInteger(in);
	}

	@Override
	public String toString() {
		StringBuilder s = new StringBuilder("{");

		s.append("shareType=");
		if (this.shareType == null)
			s.append("(null)");
		else
			s.append(Integer.toString(this.shareType));
		s.append("}");

		return s.toString();
	}
}
